import { req } from '@/fetch/req_util.js'

const BASE_URL = 'http://localhost:12001'
// const BASE_URL = 'http://120.79.188.68:9201'
// const jsonPostHeaderConfig = {
//   headers: {
//     'Content-Type': 'application/json'
//   }
// }

function getUrl (uri) {
  return BASE_URL + uri
}

export default {

  searchFiction: (data) => req.post(getUrl('/search/fiction'), data),
  searchCatalog: (data) => req.post(getUrl('/search/catalog'), data),
  searchChapter: (data) => req.post(getUrl('/search/chapter'), data),
  readPoint: (data) => req.post(getUrl('/bookshelf/book/point/read'), data),
  addToBookshelf: (data) => req.post(getUrl('/bookshelf/book/add'), data),
  myBookshelf: (data) => req.post(getUrl('/bookshelf/book/list'), data),

  userInfo: (data) => req.post(getUrl('/user/info'), data),
  userRegister: (data) => req.post(getUrl('/user/register'), data),
  userLogin: (data) => req.post(getUrl('/user/login'), data),
  userHeaders: (data) => req.post(getUrl('/user/headers'), data)

}
